package com.wallet.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.wallet.entity.WalletEntity;

import java.math.BigDecimal;

/**
 * 钱包服务接口
 * @author zhangguangyuang
 */
public interface WalletService extends IService<WalletEntity> {
    /**
     * 查询用户钱包余额
     * @param userId
     * @return
     */
    BigDecimal getMoneyInWallet(Integer userId);

    /**
     * 用户消费 100 元
     * @param userId
     * @param decreaseMoney
     * @return
     */
    boolean consumeHundred(Integer userId, BigDecimal decreaseMoney);

    /**
     * 获取 money和id
     * @param userId
     * @return
     */
    WalletEntity getMoneyAndIdByUserId(Integer userId);

    /**
     * 钱包退款
     * @param wallet
     * @return
     */
    boolean refundToWallet(WalletEntity wallet);

}
